package com.tjtt.tdm.system.dao;

import java.util.List;

import com.tjtt.tdm.base.EntityDAO;
import com.tjtt.tdm.exception.DaoException;
import com.tjtt.tdm.system.bean.Menu;
/**
 * 菜单dao
 * @author leung
 *
 */
public interface MenuDao extends EntityDAO<Menu>{
	/**
	 * 根据父节点ID查询Menu表的所有子节点
	 * @param parentid
	 * @return
	 * @throws DaoException
	 */
	public List<Menu> findMenuByParentId(Long parentid) throws DaoException;
	
	/**
	 * 根据父节点Id统计当前子节点的最大序号
	 * @param parentId
	 * @return
	 * @throws DaoException
	 */
	public long getMenuSequenceByParentId(Long parentId) throws DaoException;
	
	/**
	 * 向上移动菜单位置
	 * @param parentId
	 * @param seq
	 * @throws DaoException
	 */
	public void updateUpMenusPosition(Long parentId,Long seq) throws DaoException;
	/**
	 * 查询角色菜单
	 * @param parentId
	 * @param roleId
	 * @return
	 * @throws DaoException
	 */
	public List<Menu> findMenuByRoleId(Long parentId, String roleId) throws DaoException;
}
